home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / By the Book / Learn C++ (CodeWarrior) / Chap 04.02 - cin / cin.cp < prev    next >
Text File  |  1995-10-20  |  430b  |  24 lines

  1. #include <iostream.h>
  2.  
  3. const short    kMaxNameLength = 40;
  4.  
  5. int    main()
  6. {
  7.     char    name[ kMaxNameLength ];
  8.     short    myShort;
  9.     long    myLong;
  10.     float    myFloat;
  11.     
  12.     cout << "Type in your first name: ";
  13.     cin >> name;
  14.     
  15.     cout << "Short, long, float: ";
  16.     cin >> myShort >> myLong >> myFloat;
  17.     
  18.     cout << "\nYour name is: " << name;
  19.     cout << "\nmyShort: " << myShort;
  20.     cout << "\nmyLong: " << myLong;
  21.     cout << "\nmyFloat: " << myFloat;
  22.     
  23.     return 0;
  24. }